package cn.com.xcf.service;

import cn.com.xcf.dao.model.TCheckIncome;
import cn.com.xcf.dao.model.TCheckIncomeExample;
import cn.com.xcf.service.base.BaseService;
import com.xcf.entity.Page;
import com.xcf.util.PageData;

import java.util.List;
import java.util.Map;

/**
 * TCheckIncomeService接口
 * 收款对账单服务
 *
 * @author WongBin
 * @date 2017/11/22.
 */
public interface TCheckIncomeService extends BaseService<TCheckIncome, TCheckIncomeExample> {

    /**
     * 获取待核对账单列表
     * @param param
     * @param addition
     * @param page
     * @return
     */
    List getCheckUndoList(Object param, Map addition, Page page);

    /**
     * 查询对账记录
     * @param item
     * @param addition
     * @param page
     * @return
     */
    List getCheckList(TCheckIncome item,Map addition,Page page);

    /***
     * 修改对账单
     * @param checkId
     * @param undoList
     * @throws Exception
     */
    void addToCheckList(Object checkId, List undoList,Object operator)throws Exception;

    /***
     * 生成对账单
     * @param uncheckIds
     * @throws Exception
     */
    void genCheckRecord(Map<String,Object> map,List uncheckIds,Object operator)throws Exception;

    /**
     * 取消对账单
     * @param checkId
     * @throws Exception
     */
    void cancelRecord(Object checkId,Object operator)throws Exception;

    /**
     * 撤销对账
     * @param checkId
     * @param detailIds
     * @throws Exception
     */
    void invalidCheckRecordDetails(Object checkId,List detailIds,Object operator)throws Exception;

    List listItemsByCheckId(Object checkId);

    boolean resetItemStatus(Object checkId,List detailIs,int status, int currStatus);

    /***
     * 导出待对账明细
     * @param params
     * @return
     */
    List exportUndoList(Map params);

    /***
     * 导出对账单
     * @param params
     * @return
     */
    List exportCheckList(Map params);

    enum CheckIncomeStatus{
        CREATE(1),CANCEL(0),APPEND(1),UNDOITEM(0);

        int flag;
        private CheckIncomeStatus(int v){
            flag = v;
        }
        public int getFlag(){
            return flag;
        }
    }
    enum CheckIncomeDetailStatus{
        CREATE(1),CANCEL(0);

        int flag;
        private CheckIncomeDetailStatus(int v){
            flag = v;
        }
        public int getFlag(){
            return flag;
        }
    }
  /**
   * 获取发票单位
   * @return
   * @throws Exception
   */
  List  getInvoiceDept(Page page) throws Exception;
  /**
   * 获取费用列表
   * @param page
   * @return
   * @throws Exception
   */
  List getFeeList(PageData pd) throws Exception;
  /**
   * 获取汇率
   * @return
   * @throws Exception
   */
  Object getExchangeRate() throws Exception;
  /*拆分费用*/
  void updateDivFeeItems(List<PageData> list) throws Exception;
  
  void insertInvoiceApp(PageData pd) throws Exception;
  
  Object getInvoiceAppCode(Map<String, Object> param) throws Exception;
  
  List getopenTicketFeeType() throws Exception;
  
  double getChangeTicketFee(int id) throws Exception;
  
  public List<Map<String,Object>> getOpenTicketFeeItems(Object checkId) throws Exception;
  
  public void insertInvoiceAppItem(Map<String,Object> map) throws Exception;
  
  
  
}